<template>
	<view class="body">
		<!-- <cmd-nav-bar title="我的" font-color="#fff" background-color="linear-gradient(to right, #6838FF, #204DDF)"></cmd-nav-bar> -->
		<view>
			<view class="userInfo">
				<!-- <u-avatar text="头像" fontSize="18" size="50" randomBgColor></u-avatar> -->
				<view class="userInfo_nick">
					<!-- <text>{{filterNull(userName)}}</text> -->
					<text>{{filterNull(phone)}}</text>
				</view>
			</view>
			
			<image class="imgBg" src="../static/mine/mine_topbg.png" mode="scaleToFill"></image>
		</view>
		
		
		<view class="sectionContent">
			<view class="sectionTitle">我的学习专栏</view>
			<view class="mitem" @click="clickItem(0)">
				<view style="display: flex; align-items: center;">
					<image style="width: 35upx;height: 35upx;margin-right: 10upx;" src="../static/mine/mine_icon2.png" mode=""></image>
					<text>浏览历史</text>
				</view>
				<u-icon name="arrow-right" color="#333333" size="14"></u-icon>
			</view>
			<u-line color="#E4E4E4" ></u-line>
			<view class="mitem" @click="clickItem(1)">
				<view style="display: flex; align-items: center;">
					<image style="width: 35upx;height: 35upx;margin-right: 10upx;" src="../static/mine/mine_icon1.png" mode=""></image>
					<text>学习统计</text>
				</view>
				<u-icon name="arrow-right" color="#333333" size="14"></u-icon>
			</view>
		</view>
		
		<view class="sectionContent" style="margin-top: 20upx;">
			<view class="sectionTitle">我的学习测验</view>
			<view class="mitem" @click="clickItem(2)">
				<view style="display: flex; align-items: center;">
					<image style="width: 35upx;height: 35upx;margin-right: 10upx;" src="../static/mine/mine_icon2.png" mode=""></image>
					<text>学习测验历史</text>
				</view>
				<u-icon name="arrow-right" color="#333333" size="14"></u-icon>
			</view>
			<u-line color="#E4E4E4" ></u-line>
			<view class="mitem" @click="clickItem(3)">
				<view style="display: flex; align-items: center;">
					<image style="width: 35upx;height: 35upx;margin-right: 10upx;" src="../static/mine/mine_icon1.png" mode=""></image>
					<text>分数统计</text>
				</view>
				<u-icon name="arrow-right" color="#333333" size="14"></u-icon>
			</view>
		</view>
		
		<!-- <text class="logout" @click="loginOut">退出登录</text> -->
		<tabbar :tab="3"></tabbar>
	</view>
</template>

<script>
import tabbar from '@/components/tabbar/tabbar.vue';
import cmdNavBar from '@/components/cmd-nav-bar/cmd-nav-bar.vue';
export default {
	components: {
		tabbar,
		cmdNavBar
	},
	data() {
		return {
			naviUrl: [
				'./course-history',
				'./study-statistical',
				'./test-history',
				'./score-statistical'
			],
			
		};
	},
	
	computed:{
		userName(){
			return this.$store.state.user.userInfo.nickName;
		},
		phone(){
			return this.$store.state.user.userInfo.phone;
		}
	},

	Scroll(e) {
		// 重点，用到滑动切换必须加上
		this.$refs.hxnb.pageScroll(e);
	},
	methods: {
		clickItem(index) {
			uni.navigateTo({
				url: this.naviUrl[index]
			})
		},
		loginOut()  {
			this.$store.commit('setHasLogin', false);
			this.$store.commit('setUserInfo', null);
			uni.reLaunch({
			    url: '../login/login'
			});
		}
	}
};
</script>

<style lang="scss" scoped>
	
.body{
    /*距离顶部范围应该在88-95范围内*/
    // padding-top: 90upx;
    // top: var(--status-bar-height);
}

.imgBg {
	width: 100%;
	height: 220upx;
	// margin-top: 140upx;
	position: fixed;
	top: 0;
	left: 0;
	z-index: -1;
}
.userInfo {
	display: flex;
	margin: 40upx 74upx;
	text-align: center;
	&_nick {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin-left: 10upx;
		align-items: flex-start;
		text {
			// display: inline-block;
			color: #fff;
			font-size: 33upx;
		}
	}
}


.sectionContent {
	background-color: #fff;
	position: relative;
	top: -15upx;
	border-radius: 16upx;
	box-shadow: 0px 0px 68upx 0px rgba(69,69,69,0.13); 
	padding: 0 40upx;
	margin: 0 35upx;
	
	.sectionTitle {
		padding: 20upx 10upx;
		font-size: 32upx;
		font-family: Source Han Sans CN, Source Han Sans CN-Medium;
		font-weight: bold;
		text-align: left;
		color: #333333;

	}
}

.mitem {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 97upx;
	&_icon {
		width: 30upx;
		height: 30upx;
		margin-right: 15upx;
	}
	&_title {
		font-size: 30px;
		font-family: Source Han Sans CN, Source Han Sans CN-Regular;
		font-weight: bold;
		text-align: center;
		color: #333333;
		
	}
}


	.logout {
		height: 98upx;
		display: block;
		text-align: center;
		line-height: 100upx;
		font-size: 32upx;
		color: #12B9A3;
		border-radius: 13upx;
		background-color: #FFFFFF;
		border: solid 2upx #12B9A3;
		margin: 40upx 36upx 60upx;
		font-weight: 600;

	}

</style>
